OCLOperators difference

The difference between 2 collections: collection2 subtracted from collection1.

Example: for A,B,C,D and B,C,D,E,F the difference is A.

Set{'a','b','c','d'}->difference(Set{'b','c','d','e'})
= 'a'

Set{'a','b','c','d','e'}->difference(Set{'b','c','d','e'})
= 'a'

Set{'a','b','c','d','e','f'}->difference(Set{'b','c','d','e'})
='a','f'
Set{'a','b','c','d','e','f'}->difference(Set{'a','b','c','d','e','f'})
= empty
Set{'a','b','c','d','e','f'}->difference(Set{'a','b','c','d','e','f','g'})
= empty
Set{'a','b','c','d','e','f','g'}->difference(Set{'a','b','c','d','e','f'})
= 'g'
2019-11-25 13h27 03.png

See: Examples_on_collection_operators

In Linq, this can be achieved with "Except".

See also: OCLOperators_symmetricDifference

Video: OCL Operators: difference

This page was edited 12 days ago on 12/10/2024. What links here